﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using ESOL.Common.Entity;
using System.Data;
using ESOL.Common.DTO;

namespace ESOL.Services
{
    [ServiceContract]
    public interface IFaService
    {
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool TestConnect();

        //固定资产类型
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        FaAssetsTypeEntity GetFaAssetsTypeByKey(string id);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        FaAssetsEntity GetFaAssetByKey(string id);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveFaAsset(string userNo, FaAssetsEntity asset);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<FaAssetsEntity> GetAllChildAssets(FaAssetsEntity asset);

        //固定资产历史
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetFaRepairHisAllDsByAssetId(string assetId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetFaManufactureHisAllDsByAssetId(string assetId);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetFaUsedHisAllDsByAssetId(string assetId);

        //固定资产保养
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        FaManufacturerEntity GetFaManufacturerByKey(string id);

        //保存固定资产保养
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveFaManufacturer(string userNo, FaManufacturerEntity entity);


        //固定资产分页查询
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetFaAssetsAllDsByCondition(AssetQueryCondition con);

        //固定资产维修记录
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        FaRepairEntity GetFaRepairByKey(string id);

        //固定资产维修记录保存
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveFaRepair(string userNo, FaRepairEntity entity);


        //固定资产类型，检查类型编码
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool CheckTypeCode(string code, string typeId);

        //固定资产类型保存
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveFaAssetType(string userNo, FaAssetsTypeEntity entity);

        //查询所有的固定类型
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        List<FaAssetsTypeEntity> GetFaAssetsTypeAllList();

        //保存固定资产使用申请
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaveFaAssetApp(string userNo, FaUsedApplicationEntity entity);

        //审核固定资产使用申请
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool ApproveFaUseApp(string userNo, FaUsedApplicationEntity entity);

        //固定资产变卖查询
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        FaSaleAssetsEntity GetFaSaleAssetByKey(string id);

        //变卖固定资产
        /// 1：设置固定资产状态为变卖状态
        /// 2：增加一笔历史记录
        /// 3：更改固定资产所属情况
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool SaleAsset(FaAssetsEntity asset, FaSaleAssetsEntity salesInfo, bool isNew);

        //固定资产删除
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DelFaAsset(FaAssetsEntity asset);

        //分页查询固定资产保养信息
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetFaManufactureAllDsByCondition(ManufacturerQueryCondition con);

        //分页查询固定资产维修信息
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetFaRepairAllDsByCondition(FaRepairQueryCondition con);


        //分页查询固定资产类型
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetFaAssetTypeAllDsByCondition(string condition, string orderBy, string rowCount);

        //删除固定资产类型
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool DelFaAssetType(FaAssetsTypeEntity entity);

        //分页查询固定资产使用申请
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetFaAssetUseAppAllDsByCondition(FaUseAppQueryCondition con);

        //固定资产使用申请更新
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool UpdateFaAssetUseApp(string userNo, FaUsedApplicationEntity entity);

        //分页查询固定资产使用
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        DataSet GetFaAssetUseAllDsByCondition(FaUseQueryCondition con);

        //归还固定资产
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool ReturnFaAsset(string userNo, FaAssetsEntity asset);

        //报废固定资产
        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        bool ScrapAsset(string userNo, FaAssetsEntity asset);

        [OperationContract]
        [FaultContract(typeof(ProcessExecutionFault))]
        FaUsedEntity GetFaUsedByKey(string id);

    }
}
